package com.example.sensors;

import java.util.ArrayList;
import java.util.List;

import android.R.array;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.util.Log;
import android.view.Menu;
import android.widget.ArrayAdapter;

public class MainActivity extends ListActivity{

	List<String> list = new ArrayList<String>();
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		   SensorManager mgr = (SensorManager) getSystemService(SENSOR_SERVICE);
		    List<Sensor> sensors = mgr.getSensorList(Sensor.TYPE_ALL);
		    for (int i =0; i<sensors.size();i++){		    	
		    	list.add(sensors.get(i).getName());
		    	
		    }
		ArrayAdapter<String> nigger = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,list);
		setListAdapter(nigger);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}


	
	

}








